package com.example.util;

import java.util.List;

/**
 * @author Jiamingzhen
 * @Date 2021/4/16 15:45
 * @ClassName PageResult
 * @Introduce
 */
public class PageResult<T> {
    private int code;
    private String msg;
    private long count;
    private List<T> data;

    public PageResult() {
    }

    public PageResult(List<T> rows) {
        this.data = rows;
        this.count = (long)rows.size();
        this.code = 0;
        this.msg = "";
    }

    public PageResult(List<T> rows, long total) {
        this.count = total;
        this.data = rows;
        this.code = 0;
        this.msg = "";
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public long getCount() {
        return this.count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public List<T> getData() {
        return this.data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
